<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>brightscript.brs</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (BrightScript) - Theme (Breeze Dark)"/>
</head><body style="background-color:#232629;color:#cfcfc2"><pre>

<span style="color:#27ae60;">#i am macro</span>

<span style="color:#27ae60;">library </span><span style="color:#f44f4f;">&quot;a&quot;</span>

<span style="font-weight:bold;">function</span> <span style="color:#8e44ad;">myfunc</span> ( <span style="color:#27aeae;">foo</span> <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Integer</span> , <span style="color:#27aeae;">bar</span> <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Float</span> = <span style="color:#f67400;">3.5</span> ) <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Void</span>
<span style="font-weight:bold;">end function</span>

<span style="font-weight:bold;">sub</span> <span style="color:#8e44ad;">mysub</span> ( <span style="color:#27aeae;">foo</span> <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Integer</span> , <span style="color:#27aeae;">bar</span> <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Float</span> = <span style="color:#f67400;">3.5</span> ) <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Void</span>
<span style="font-weight:bold;">end sub</span>

<span style="color:#7a7c7d;">' my comment</span>

<span style="font-weight:bold;">Function</span> <span style="color:#8e44ad;">MyCamelCaseFunction</span>()
    <span style="color:#27aeae;">lvalue</span> = <span style="color:#27aeae;">rvalue</span>
<span style="color:#27aeae;">a</span>=<span style="color:#f67400;">5</span>
<span style="color:#27aeae;">a</span>=<span style="color:#f67400;">5!</span>
<span style="color:#27aeae;">a</span>=<span style="color:#f67400;">5#</span>
<span style="color:#27aeae;">a</span>=<span style="color:#f67400;">5%</span>
<span style="color:#27aeae;">a</span>=<span style="color:#f67400;">5&amp;</span>

<span style="color:#27aeae;">a$</span>=<span style="color:#f67400;">5</span>
<span style="color:#27aeae;">a!</span>=<span style="color:#f67400;">5</span>
<span style="color:#27aeae;">a#</span>=<span style="color:#f67400;">5</span>
<span style="color:#27aeae;">a%</span>=<span style="color:#f67400;">5</span>
<span style="color:#27aeae;">a&amp;</span>=<span style="color:#f67400;">5</span>

<span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">a$</span>
<span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">a!</span>
<span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">a#</span>
<span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">a%</span>
<span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">a&amp;</span>

<span style="color:#8e44ad;">foo</span>()
<span style="color:#27aeae;">a</span>.<span style="color:#8e44ad;">foo</span>()
<span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">a</span>.<span style="color:#8e44ad;">foo</span>()

<span style="color:#da4453;text-decoration:underline;">eval</span>=5
<span style="color:#7f8c8d;">eval</span>()
<span style="color:#27aeae;">a</span>.<span style="color:#8e44ad;">eval</span>()

<span style="color:#27aeae;">a</span>=<span style="color:#da4453;text-decoration:underline;">eval</span>
<span style="color:#27aeae;">a</span>=<span style="color:#7f8c8d;">eval</span>()
<span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">a</span>.<span style="color:#8e44ad;">eval</span>()

<span style="color:#27aeae;">sleep</span>=<span style="color:#f67400;">5</span>
<span style="color:#7f8c8d;">sleep</span>()
<span style="color:#27aeae;">a</span>.<span style="color:#8e44ad;">sleep</span>()

<span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">sleep</span>
<span style="color:#27aeae;">a</span>=<span style="color:#7f8c8d;">sleep</span>()
<span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">a</span>.<span style="color:#8e44ad;">sleep</span>()

<span style="color:#fdbc4b;font-weight:bold;">if</span> <span style="color:#27aeae;">a</span>=<span style="color:#27aeae;">b</span> <span style="color:#27aeae;">c</span>=<span style="color:#27aeae;">d</span>
<span style="color:#fdbc4b;font-weight:bold;">if</span> <span style="color:#27aeae;">a</span> <span style="color:#8e44ad;">foo</span>()
<span style="color:#fdbc4b;font-weight:bold;">if</span> <span style="color:#27aeae;">a</span> <span style="color:#fdbc4b;font-weight:bold;">then</span> <span style="color:#8e44ad;">foo</span>()

<span style="color:#fdbc4b;font-weight:bold;">if</span> <span style="color:#27aeae;">a</span>
<span style="color:#fdbc4b;font-weight:bold;">end if</span>

<span style="color:#fdbc4b;font-weight:bold;">if</span> <span style="color:#27aeae;">a</span> <span style="color:#fdbc4b;font-weight:bold;">then</span>
<span style="color:#fdbc4b;font-weight:bold;">end if</span>

<span style="color:#fdbc4b;font-weight:bold;">if</span> <span style="color:#27aeae;">a</span>
<span style="color:#fdbc4b;font-weight:bold;">else</span> <span style="color:#fdbc4b;font-weight:bold;">if</span>
<span style="color:#fdbc4b;font-weight:bold;">else</span>
<span style="color:#fdbc4b;font-weight:bold;">end if</span>

<span style="color:#fdbc4b;font-weight:bold;">if</span> <span style="color:#27aeae;">a</span>
<span style="color:#fdbc4b;font-weight:bold;">elseif</span>
<span style="color:#fdbc4b;font-weight:bold;">endif</span>

<span style="color:#fdbc4b;font-weight:bold;">for</span> <span style="color:#fdbc4b;font-weight:bold;">each</span> <span style="color:#27aeae;">a</span> <span style="color:#fdbc4b;font-weight:bold;">in</span> <span style="color:#27aeae;">b</span>
<span style="color:#fdbc4b;font-weight:bold;">end for</span>

<span style="color:#fdbc4b;font-weight:bold;">for</span> <span style="color:#27aeae;">a</span>=<span style="color:#f67400;">1</span> <span style="color:#fdbc4b;font-weight:bold;">to</span> <span style="color:#f67400;">10</span> <span style="color:#fdbc4b;font-weight:bold;">step</span> <span style="color:#f67400;">2</span>
<span style="color:#fdbc4b;font-weight:bold;">endFor</span>

<span style="color:#fdbc4b;font-weight:bold;">for</span> <span style="color:#fdbc4b;font-weight:bold;">each</span> <span style="color:#27aeae;">a</span> <span style="color:#fdbc4b;font-weight:bold;">in</span> <span style="color:#27aeae;">b</span>
<span style="color:#fdbc4b;font-weight:bold;">next</span>

<span style="color:#fdbc4b;font-weight:bold;">while</span> <span style="color:#27aeae;">a</span>
<span style="color:#fdbc4b;font-weight:bold;">end while</span>

<span style="color:#fdbc4b;font-weight:bold;">while</span> <span style="color:#27aeae;">a</span>
<span style="color:#fdbc4b;font-weight:bold;">endWhile</span>

<span style="color:#27aeae;">a</span> [ <span style="color:#f44f4f;">&quot;a&quot;</span> , <span style="color:#f67400;">1</span>, <span style="color:#8e44ad;">foo</span>() ] = <span style="color:#f67400;">1</span>
<span style="color:#27aeae;">a</span>.<span style="color:#8e44ad;">foo</span>()[<span style="color:#f67400;">1</span>]=<span style="color:#f67400;">1</span>

<span style="color:#27aeae;">a</span> = {
    <span style="color:#27aeae;">a</span> : <span style="color:#f67400;">1</span>
    <span style="color:#27aeae;">b</span> : <span style="color:#f44f4f;">&quot;2&quot;</span>
    <span style="color:#27aeae;">c</span> : <span style="font-weight:bold;">function</span>() <span style="color:#3daee9;">:</span> <span style="font-weight:bold;">end function</span>
}

<span style="color:#27aeae;">b</span>.<span style="color:#8e44ad;">foo</span>(<span style="color:#f44f4f;">&quot;string&quot;</span>,<span style="color:#f67400;">1</span>,{<span style="color:#27aeae;">a</span>:<span style="color:#27aeae;">b</span>},<span style="color:#f67400;">1.5</span>,[<span style="color:#f67400;">1</span>,<span style="color:#f67400;">2</span>,<span style="color:#f67400;">3</span>])
<span style="color:#27aeae;">a</span> = <span style="color:#27aeae;">b</span>.<span style="color:#8e44ad;">foo</span>(<span style="color:#f44f4f;">&quot;string&quot;</span>,<span style="color:#f67400;">1</span>,{<span style="color:#27aeae;">a</span>:<span style="color:#27aeae;">b</span>},<span style="color:#f67400;">1.5</span>,[<span style="color:#f67400;">1</span>,<span style="color:#f67400;">2</span>,<span style="color:#f67400;">3</span>])

<span style="color:#27aeae;">unnamed_function</span> = <span style="font-weight:bold;">function</span> ( <span style="color:#27aeae;">a</span> <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Integer</span> ) <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Float</span>

<span style="color:#27aeae;">a</span> = +-<span style="color:#27aeae;">b</span>
<span style="color:#27aeae;">a</span> = <span style="color:#f67400;">&amp;h42abcdef</span>
<span style="color:#27aeae;">c</span> = <span style="color:#27aeae;">var</span>@<span style="color:#27aeae;">attr</span>
<span style="font-weight:bold;">end function</span>

<span style="color:#27aeae;">unnamed_sub</span> = <span style="font-weight:bold;">sub</span> ( <span style="color:#27aeae;">a</span> <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Integer</span> ) <span style="font-weight:bold;">as</span> <span style="color:#2980b9;">Void</span>
<span style="font-weight:bold;">end sub</span>
<span style="font-weight:bold;">endFunction</span>

<span style="font-weight:bold;">sub</span> <span style="color:#8e44ad;">exceptions</span>()
	<span style="color:#27aeae;">try</span>=<span style="color:#f67400;">1</span>
	<span style="color:#8e44ad;">try</span>()
	<span style="color:#27aeae;">try</span>.<span style="color:#27aeae;">foo</span>
	<span style="color:#27aeae;">try</span> <span style="color:#27aeae;">foo</span>

	<span style="color:#27aeae;">catch</span>=<span style="color:#f67400;">1</span>
	<span style="color:#8e44ad;">catch</span>()
	<span style="color:#27aeae;">catch</span>.<span style="color:#27aeae;">foo</span>
	<span style="color:#27aeae;">catch</span> <span style="color:#27aeae;">foo</span>

	<span style="font-weight:bold;">try</span>
	<span style="font-weight:bold;">catch</span> <span style="color:#27aeae;">foo</span>
	<span style="font-weight:bold;">end</span> <span style="font-weight:bold;">try</span>

	<span style="font-weight:bold;">try</span> <span style="color:#7a7c7d;">' comment</span>
	<span style="font-weight:bold;">endtry</span>

	<span style="font-weight:bold;">throw</span> {<span style="color:#27aeae;">a</span>: <span style="color:#f44f4f;">&quot;abc&quot;</span>}
<span style="font-weight:bold;">end sub</span>
</pre></body></html>
